package com.kitemap.widget.business
{
	import mx.collections.ArrayCollection;
	import mx.utils.ObjectUtil;
	
	import flash.events.Event;
	import flash.events.EventDispatcher;    

	public class UserManager extends EventDispatcher
    {
        private var _user:Object;
        private var _recentUsersWithPhotos:ArrayCollection;
        public function setRecentUsersWithPhotos(users:ArrayCollection):void 
        {
            _recentUsersWithPhotos = users;
            dispatchEvent(new Event("recentUsersWithPhotosChange"));
        }
        
        [Bindable (event="recentUsersWithPhotosChange")]
        public function get recentUsersWithPhotos():ArrayCollection
        {
            return (_recentUsersWithPhotos != null)?_recentUsersWithPhotos:null;
        }
        
        [Bindable (event="userChange")]
        public function get user():Object
        {
            return (_user != null)?_user:null;
        }

        public function setUser(user:Object):void
        {
        	trace("user:" + ObjectUtil.toString(user));
        	 _user = user;
        	 dispatchEvent(new Event("userChange"));
        }
        
        public function handleFault(message:String):void {
            trace(message);
        }

    }
}